<?php

namespace common\entities\myhtsq;

use common\entities\ContractEntity;
use Yii;

/**
 * This is the model class for table "myscrm_contract_property".
 *
 * @property string $property_id
 * @property string $property_name
 * @property integer $order_by
 * @property string $created_on
 * @property string $created_by
 * @property string $modified_on
 * @property string $modified_by
 */
class ContractPropertyEntity extends ContractEntity
{
	/**
	 * 云客签约-直属区域
     * 云客签约-直属
	 * @var string
	 */
	const MYYK_PROPERTY_DIRECTLY_UNDER_ID = '7f83719a-fce8-11e4-bed8-00155d02c832';

	/**
	 * 云客签约-联营区域
     * 云客签约-联营
	 * @var string
	 */
	const MYYK_PROPERTY_JOINT_OPERATION_ID = '7f8422d0-fce8-11e4-bed8-00155d02c832';

    /**
     * 云客直销
     * @var string
     */
    const MYYK_PROPERTY_DIRECT_SALES_ID = 'efa353cd-51ca-11e8-a035-00155d02c83e';

	//这三种情况不走校验
    /**
     * 联营签约-云客结算
     * @var string
     */
    const MYYK_PROPERTY_JOINT_SIGNED_SETTLEMENT_OPERATION_ID = '7f856e81-fce8-11e4-bed8-00155d02c832';

    /**
     * 明源签约-直属
     * @var string
     */
    const MY_PROPERTY_DIRECTLY_OPERATION_ID = '54f8a2b7-fce7-11e4-bed8-00155d02c832';

    /**
     * 明源签约-联营
     * @var string
     */
    const MY_PROPERTY_JOINT_OPERATION_ID = '7f828b1b-fce8-11e4-bed8-00155d02c832';


	
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'myscrm_contract_property';
    }

    public static function globalTableName()
    {
        preg_match("/dbname=([^;]+)/i", self::getDb()->dsn, $matches);
        return $matches[1].'.myscrm_contract_property';
    }
    
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['property_id'], 'required'],
            [['order_by'], 'integer'],
            [['created_on', 'modified_on'], 'safe'],
            [['property_id', 'created_by', 'modified_by'], 'string', 'max' => 36],
            [['property_name'], 'string', 'max' => 50]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'property_id' => '性质ID',
            'property_name' => '性质名称',
            'order_by' => '排序',
            'created_on' => '创建时间',
            'created_by' => '创建人',
            'modified_on' => '修改时间',
            'modified_by' => '修改人',
        ];
    }




}
